import { ValidatorFn } from '@angular/forms';
export class QuestionBase<T>{
    value: T;
    key: string;
    label: string;
    required: boolean;
    order: number;
    controlType: string;
    minlength: number;
    maxlength: number;
    pattern: string;
    errorMessages: { [key: string]: string };
    customerValitor: () => ValidatorFn;
    constructor(options: {
        value?: T,
        key?: string,
        label?: string,
        required?: boolean,
        order?: number,
        controlType?: string,
        minlength?: number,
        maxlength?: number,
        pattern?: string,
        errorMessages?: { [key: string]: string },
        customerValitor?: () => ValidatorFn
    } = {}) {
        this.value = options.value;
        this.key = options.key || '';
        this.label = options.label || '';
        this.required = !!options.required;
        this.order = options.order === undefined ? 1 : options.order;
        this.controlType = options.controlType || '';
        this.minlength = options.minlength;
        this.maxlength = options.maxlength;
        this.pattern = options.pattern;
        this.errorMessages = options.errorMessages;
        this.customerValitor = options.customerValitor;
    }
}
